<!--main-->
<div class="search_top">
	<ul class="pagenavi">
		<li><a href="/index.html">首页</a></li>
		<li class="li2">会员注册</li>
	</ul>
</div>
<div class="search_main">
	<div class="search_main_title">会员注册</div>
	<div class="login_main_1">
	<form name="mainform" action="regist.php" method="post">
		<input type="hidden" name="cmd" value="regist">
		<table cellpadding="0" cellspacing="0" border="0" align="center">
			<tr align="center">
				<td align="right" width="40%"><span class="title">用户名：</span></td>
				<td align="left" width="60%"><input id="user_name" type="text" name="user_name" value="{{$user_name}}" class="text" maxlength="30" tabindex="1">
					{{if $systemMsg.user_name != '' }}
						<span id='user_namemsg' class="error">
						{{$systemMsg.user_name}}
					{{else}}
						<span id='user_namemsg'>
						中英文均可
					{{/if}}
					</span>
				</td>
			</tr>
			<tr align="center">
				<td align="right"><span class="title">邮&nbsp;箱：</span></td>
				<td align="left"><input id="email" type="text" name="email" value="{{$email}}" class="text" maxlength="100" style="ime-mode:disabled" tabindex="2">
					{{if $systemMsg.email != '' }}
						<span id='emailmsg' class="error">
						{{$systemMsg.email}}
					{{else}}
						<span id='emailmsg'>
						邮箱地址用于取回密码
					{{/if}}
					</span>
				</td>
			</tr>
			<tr align="center">
				<td align="right"><span class="title">密&nbsp;码：</span></td>
				<td align="left"><input type="password" name="password" id="password" value="{{$password}}" class="text" maxlength="30" style="ime-mode:disabled" tabindex="3">
					{{if $systemMsg.password != '' }}
						<span id='passwordmsg' class="error">
						{{$systemMsg.password}}
					{{else}}
						<span id='passwordmsg'>
					{{/if}}
					</span>
				</td>
			</tr>
			<tr align="center">
				<td align="right"><span class="title">确认密码：</span></td>
				<td align="left"><input type="password" name="password_again" id="password_again" value="" class="text" maxlength="30" style="ime-mode:disabled" tabindex="4">
					{{if $systemMsg.password_again != '' }}
						<span id='password_againmsg' class="error">
						{{$systemMsg.password_again}}
					{{else}}
						<span id='password_againmsg'>
					{{/if}}
					</span>
				</td>
			</tr>
			<tr align="center">
				<td align="right"><span class="title">验&nbsp;证&nbsp;码：</span></td>
				<td align="left"><input id="word" name="word" id="word" value="{{$word}}" type="text" maxlength="4" style="width:70px;ime-mode:disabled" tabindex="5"/>
				<img src="/login.php?cmd=captcha"  align="absmiddle" onClick="this.src='this.src='/login.php?cmd=captcha&'+Math.random()">
					{{if $systemMsg.word != '' }}
						<span id='wordmsg' class="error">
						{{$systemMsg.word}}
					{{else}}
						<span id='wordmsg'>
					{{/if}}
					</span>
					</span>
				</td>
			</tr>
			<tr align="center">
				<td colspan="2"><br/><input type="image" src="images/register_submit.gif" tabindex="6"></td>
			</tr>
		</table>
		</form>
	</div>
</div>
<!--main end -->
<script type="text/javascript" src="/script/jquery.js"></script>
<script type="text/javascript" src="/script/common.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){	
	$("input").focus(function(){
		var id=$(this).attr('id');
		$("#"+id+"msg").removeClass().html("");
	});

    $("input").blur(function(){ 
		var id=$(this).attr('id');
		var checkFun="";
		var addUrl="";
		switch(id){
			case 'user_name':checkFun="ajaxCheckUserName";break;
			case 'email':checkFun="ajaxCheckEmail";break;
			case 'password':checkFun="ajaxCheckPassword";break;
			case 'password_again':checkFun="ajaxCheckPasswordAgain";
								  addUrl="&password="+$("#password").val();
								  break;
			case 'word':checkFun="ajaxCheckWord";break;
		}
		if(checkFun=="")return;
    	var input=$(this).val();
    	if(input != ''){
    		$.ajax({
		        type:"POST",
		        url:"regist.php?cmd="+checkFun+"&"+id+"="+input+addUrl,
		        success:function(msg){
					if(msg=='1'){
						$("#"+id+"msg").removeClass().addClass("error").html("<input type=\"image\" src=\"images/msg_ok.png\">");
					}else{
						$("#"+id+"msg").removeClass().addClass("error").html(msg);
					}
		        }            
		     });
    	}
		
    });
	
});
</script>